import request from '../../utils/request'


import type { BaseResData } from './type'

enum API {
    GET_SCAN_CODE_GOODS_URL = '/artificial/cashier/index/get_goods',
    CREATE_ORDER_URL = "/artificial/cashier/index/create",
    PRINT_URL = "/artificial/cashier/index/print"
}

/**
 * 扫码获取商品信息
 */
export const getGoodsByCode = (params: any) => {
    return request.post<any, BaseResData>(API.GET_SCAN_CODE_GOODS_URL, params);
}

/**
 * 创建订单
 */
export const createOrder = (params: any) => {
    return request.post<any, BaseResData>(API.CREATE_ORDER_URL, params);
}

/**
 * 打印订单发票
 */
export const printOrder = (params: any) => {
    return request.post<any, BaseResData>(API.PRINT_URL, params);
}